<%=render 'layouts/header'%>

<div class="container plat new">
    <%=form_for @plat, :url => @plat.persisted? ? app_plat_path(@plat.app,@plat) : app_plats_path, :html => { :method => @plat.new_record? ? "post" : "put", class: "app_form" } do |f|%>

    <%= hidden_field_tag "plat[app_id]", @plat.app_id %>

    <div class="title"><span> <%=@plat.persisted? ? "修改渠道" : "新建渠道" %> </span></div>

    <div class="form-group">
      <label for="plat_name">渠道名称*：</label>
      <%= f.text_field :name, class:"form-control", required:true %>
    </div>

    <div class="form-group">
      <label for="plat_name">校验包名：</label>
      <%= f.text_field :bundle_id, class:"form-control", placeholder:"不填则不校验,支持通配符*号" %>
    </div>

    <div class="form-group">
      <label for="plat_name">包类型*：</label>
      <%= f.select(:plat_name,pkg_selectable_map,{},{class:"form-control"}) %>
    </div>

    <div class="form-group">
      <label for="plat_name">不允许重复包：</label>
      <%= f.select(:pkg_uniq,{'YES'=>'true','NO'=>'false'},{},{class:"form-control"}) %>
    </div>

    <% if @plat.persisted? %>
      <%=f.submit "保存", class:"btn btn-primary ui-plat"%>
    <% else %>
      <%=f.submit "新建", class:"btn btn-primary ui-plat"%>
    <% end %>
    
  <%end%>
</div>